﻿using gixoom.Dom.Block;
using gixoom.Dom.Score;
using gixoom.Dom.Storage.Block;
using gixoom.Dom.Storage.File;
using Ninject;

namespace gixoom.Dom
{
    public class gixoomDomFacade: IgixoomDomFacade
    {
        private IKernel kernel;

        /// <summary>
        /// Creates gixoomDomFacade object.
        /// </summary>
        /// <param name="kernel">the kernel</param>
        /// <exception cref="System.ArgumentNullException"><i>kernel</i> is a null reference.</exception>
        public gixoomDomFacade(IKernel kernel)
        {
            Ensure.ArgumentNotNull(kernel, "kernel");

            this.kernel = kernel;
        }

        /// <summary>
        /// Returns score facade.
        /// </summary>
        /// <returns>score facade</returns>
        public IScoreFacade GetScoreFacade()
        {
            var facade = kernel.Get<IScoreFacade>();
            return facade;
        }

        /// <summary>
        /// Returns block facade.
        /// </summary>
        /// <returns>block facade</returns>
        public IBlockFacade GetBlockFacade()
        {
            var facade = kernel.Get<IBlockFacade>();
            return facade;
        }

        /// <summary>
        /// Returns file storage facade.
        /// </summary>
        /// <returns>file storage facade</returns>
        public IFileStorageFacade GetFileStorageFacade()
        {
            var facade = kernel.Get<IFileStorageFacade>();
            return facade;
        }

        /// <summary>
        /// Returns block storage facade.
        /// </summary>
        /// <returns>block storage facade</returns>
        public IBlockStorageFacade GetBlockStorageFacade()
        {
            var facade = kernel.Get<IBlockStorageFacade>();
            return facade;
        }
    }
}
